1. Field of the Invention
This invention relates to computer systems, and specifically to compatibility issues between platforms and the applications intended to run on them.
2. Background Art
Computer software developers are creating software applications and programs for non-traditional environments. Instead of only creating programs for desktop computers or laptop computers, developers are also creating programs for other systems that may have xe2x80x9cembedded processorsxe2x80x9d to add or enhance functionality. Such devices include cellular phones, personal digital assistants, smart cards, pagers, and other devices. An environment in which a software application will be used is referred to here as a xe2x80x9cplatformxe2x80x9d.
In developing software applications for new and emerging platforms, it is important to be able to test and analyze the software for compliance with these platforms. This allows the developer to determine if the software is compatible with the platform. Debugging software can be used to provide some analytical capability at run time, but does not provide flexibility for new or changing platforms. Linkers and other build tools link code. That is, build tools create executable code from object code and warn, at build time, when references are unresolved. A build tool is limited in scope to the object code that it is linking. It does not verify or assess the code""s compliance with a platform.
With the popularity of network systems, such as the World Wide Web, there is a need to provide more compatibility of computer and non-computer platforms to the Web. The Java(trademark) language developed by Sun JavaSoft(trademark) has provided a way to write platform independent applications to run on the Web and provide the desired compatibility. Some platforms may have unique and/or proprietary interfaces, limited memory and display sizes, constrained power consumption, user response time, and limited physical space. These platform are referred to here as restrictive environments. A version of Java(trademark) called PersonalJava(trademark) has been developed by JavaSoft to be used with, among other things, restrictive environments. A description of Java and PersonalJava can be found at web site xe2x80x9chttp:/ /www.java.sun.comxe2x80x9d.
When writing applications for devices, whether using Java, PersonalJava, or any other language, it is important to be able to analyze the applications for compatibility with the intended device. Debugging programs have been used in the past to provide some analysis capabilities. However, with the number of different environments of portable devices, the number of debugging programs required becomes unweildy. It would be desirable to have a general solution to the problem of analyzing the compatibility of applications with the device environment for which they are written.
Embodiments of the invention can be used to assess whether a software application is compatible with an operating platform. A specification that describes the operating platform is described by a definitional language. The specification identifies the programming resources of an operating platform The application""s dependencies and programming resources are identified. A programming resource is data and functionality that is accessible to an application (e.g., in a Java application environment, a programming resource includes methods, classes and packages). A compatibility engine is executed to resolve an application""s dependencies are resolved to the specification. The output of the compatibility engine identifies whether the application conforms to the operating platform and how it deviates from the specification.
A grammar is used to specify programming resources of the operating platform that may be used to resolve an application""s references. At least one specification is created that defines the programming resources of the operating platform. Where more than one specification is defined, the specifications are merged to create a combined definition of the operating platform. The application""s program files are parsed to identify references that must be resolved before the application can execute, The application""s programming resources are identified as well.
An attempt is made to resolve references within the application. However, the application may contain external references that cannot be resolved within the application. If neither the application nor the operating platform contains a programming resource that can resolve a reference, the reference is unresolvable.
If a reference cannot be resolved within the application, the merged specification is examined to determine whether the operating platform contains a programming resource that can be used to resolve the reference. If the programming resource is found, a compliance status associated with the programming resource is examined to determine whether it is available for use by the application. If the programming resource has a compliance status of xe2x80x9crequired,xe2x80x9d the operating platform is required to include the programming resource and the application""s reference is reported as resolved. An xe2x80x9coptionalxe2x80x9d compliance status indicates that the entry may or may not be included in the operating platform. If the optional status is not overridden by a subsequently-processed specification, the reference is reported in error (e.g., the reference is to an unimplemented optional programming resource). A xe2x80x9cmodifiedxe2x80x9d compliance status indicates that the programming resource associated with the entry has been changed. An xe2x80x9cunsupportedxe2x80x9d compliance status indicates that the application""s reference is not supported by the operating platform. A status of xe2x80x9coptional,xe2x80x9d xe2x80x9cmodifiedxe2x80x9d or xe2x80x9cunsupportedxe2x80x9d resolves the reference, but indicates a potential problem with that reference.
Either a warning or an error message is generated for those references that are not resolved to the application programming resource or a xe2x80x9crequiredxe2x80x9d specification programming resource. A xe2x80x9cnon-conformancexe2x80x9d warning is generated for those references that resolve to a xe2x80x9cmodifiedxe2x80x9d specification programming resource, or for a reference that does not resolve to a programming resource (i.e., an xe2x80x9cunresolvedxe2x80x9d status). A reference that resolves to an xe2x80x9cunsupportedxe2x80x9d or xe2x80x9coptionalxe2x80x9d specification programming resource causes a xe2x80x9cnon-conformancexe2x80x9d error.
In one embodiment of the invention, the operating platform includes a Java(trademark) application environment. The programming resources that can be used to resolve a reference include a package, class or method. The class files that comprise the application are parsed to identify its references (e.g., fields, return types and method arguments). An application dependency tree is created that identifies the application""s references.
An attempt is made to resolve references in each of the application""s class files. After all of the references have been processed, an assessment as to the application""s conformity to an operating platform and an identification as to how the application deviates is provided. This feedback can be used to determine changes that can be made to the application, the operating platform or both that would result in conformity between the application and its operating platform.